package cn.niit.letuseatdemo.mapper;

import java.util.List;

import cn.niit.letuseatdemo.entity.domain.UserAddress;
import org.springframework.stereotype.Repository;

/**
 * 用户地址Mapper接口
 * 
 * @author aoli_jojo
 * @date 2022-10-26
 */
@Repository
public interface UserAddressMapper 
{

    /*
    * @Description:查询用户地址
    * 根据用户给的地址id显示用户自己要修改的地址
    * @Author: Zhang Shiqi
    * @CreateTime： 2022/11/14 22:52
     * @param: addressId
     * @return: cn.niit.letuseatdemo.entity.domain.UserAddress
    **/
    public UserAddress selectUserAddressByDId(Long addressId);


    /*
    * @Description: 查询用户地址列表
    * 显示送货地址页面 列表显示
    * @Author: Zhang Shiqi
    * @CreateTime： 2022/11/14 22:55
     * @param: userAddress
     * @return: java.util.List<cn.niit.letuseatdemo.entity.domain.UserAddress>
    **/
    public List<UserAddress> selectUserAddressList(Long userId);

    /*
    * @Description:查默认地址
    * @Author: Zhang Shiqi
    * @CreateTime： 2023/4/24 2:10
     * @param: userId
     * @return: cn.niit.letuseatdemo.entity.domain.UserAddress
    **/
    public  UserAddress selectUserDefualtAddress(Long userId);


    /*
    * @Description: 用户地址添加
    * @Author: Zhang Shiqi
    * @CreateTime： 2022/11/14 22:55
     * @param: userAddress
     * @return: int
    **/
    public int insertUserAddress(UserAddress userAddress);


    /*
    * @Description: 修改用户地址
    * @Author: Zhang Shiqi
    * @CreateTime： 2022/11/14 22:55
     * @param: userAddress
     * @return: int
    **/
    public int updateUserAddress(UserAddress userAddress);


    /*
    * @Description:删除用户地址
    * @Author: Zhang Shiqi
    * @CreateTime： 2022/11/14 22:55
     * @param: addressId
     * @return: int
    **/
    public int deleteUserAddressByAddressId(Long addressId);


    /*
    * @Description: 根据地址id查地址
    * @Author: Zhang Shiqi
    * @CreateTime： 2023/4/25 4:18
     * @param: addressId
     * @return: cn.niit.letuseatdemo.entity.domain.UserAddress
    **/
    UserAddress selectUserAddressByAddressId(Long addressId);
}
